BCDBoot "failure when initializing library system volume"

Hey all,

Currently trying to troubleshoot a script/issue that I'm encountering. Here is the scenario.

Using a PowerShell script, I'm creating a WTG stick and using Expand-WindowsImage to lay down an OS image to a volume. After this, I am executing BCDBoot to lay down the BCD store. This is all wrapped in a advanced function.

The issue is that after the image is done being applied, my command...

Start-Process -FilePath "${OSDriveLetter}:\Windows\System32\bcdboot.exe" -WorkingDirectory "${OSDriveLetter}:\Windows\System32" -ArgumentList "${OSDriveLetter}:\Windows /f ALL /s ${SystemDriveLetter}:"

does not apply the BCD Store. I used the RedirectStandardOutput property to determine what the output of the command is and it returns the "failure when initializing library system volume". Here is the thing...if I suspend the script right after this and then execute the very same line again (variables and all) it lays down the store as expected.

So how would one troubleshoot this? Ideas?

March 11th, 2015 12:57am

Try adding a wait period prior to executing the command. Try 5 seconds.
Free Windows Admin Tool Kit Click here and download it now
March 11th, 2015 1:27pm

Thanks for the suggestion. I had thought of that but still no dice. Here is what I'm executing...

Write-Debug -Message "Writing $Image to volume $OSDriveLetter"
        Expand-WindowsImage -ImagePath $Image -ApplyPath ${OSDriveLetter}:\ -Index 1
        Write-Debug -Message 'Sleeping for 10 seconds'
        Start-Sleep -Seconds 30
        Write-Debug -Message "Calling BCDBoot.exe to write BCD Store to $SystemDriveLetter"
        Start-Process -FilePath "${OSDriveLetter}:\Windows\System32\bcdboot.exe" -WorkingDirectory "${OSDriveLetter}:\Windows\System32" -RedirectStandardOutput 'C:\Users\Administrator\Desktop\test.txt' -ArgumentList "${OSDriveLetter}:\Windows /f ALL /s ${SystemDriveLetter}:"

March 11th, 2015 1:30pm

Hi Michael,

About this issue, you will get more professional help from the forum for script.

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

Free Windows Admin Tool Kit Click here and download it now
March 12th, 2015 3:13am

What if you put a wait after the command that fails, then run the command again? It is a strange message you are receiving, I personally have not seen that one. I wonder if it is PowerShell related, I don't use that currently... What happens if you run this through a .cmd?
March 12th, 2015 11:43am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics